<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<c:set var="title" value="View Drivers" scope="page"/>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <title>${title}</title>
    </head>
    <body>
        <h1>${title}</h1>
        <f:view>
            <!-- Show error messages -->
            <h:messages showSummary="true" showDetail="false"

            style="color: red;
            font-family: 'New Century Schoolbook', serif;
            font-style: oblique"
                        id="errors"/>

            
            <h:dataTable id="vehiclesTable" value="#{DriverJSFManagedBean.allDrivers}" var="driver">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="First Name"/>
                    </f:facet>
                    <h:outputText value=" #{driver.firstName}"/>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Last Name"/>
                    </f:facet>
                    <h:outputText value=" #{driver.lastName}"/>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Email Address"/>
                    </f:facet>
                    <h:outputText value=" #{driver.emailAddress}"/>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Contact"/>
                    </f:facet>
                    <h:outputText value=" #{driver.contactNumber}"/>
                </h:column>
            </h:dataTable>
        </f:view>
    </body>
</html>